/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.type;

/**
 * 
 * @author haolw
 * @time 2017/10/24
 */
public enum TradeType {
	JSAPI(1, "JSAPI"), NATIVE(2, "NATIVE"), APP(3, "APP");

	private Integer type;
	private String name;

	private TradeType(Integer type, String name) {
		this.type = type;
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public static String getName(Integer type) {
		for (TradeType tradeType : TradeType.values()) {
			if (type.equals(tradeType.getType())) {
				return tradeType.getName();
			}
		}
		return null;
	}

	public void setName(String name) {
		this.name = name;
	}
}
